using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Multivariate
{
    /// <summary>
    /// <para>Principal Components</para>
    /// <para>Performs Principal Component Analysis (PCA) on a set of raster bands and generates a single multiband raster as output.</para>
    /// <para>对一组栅格波段执行主成分分析 （PCA），并生成单个多波段栅格作为输出。</para>
    /// </summary>    
    [DisplayName("Principal Components")]
    public class PrincipalComponents : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PrincipalComponents()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster_bands">
        /// <para>Input raster bands</para>
        /// <para><xdoc>
        ///   <para>The input raster bands.</para>
        ///   <para>They can be integer or floating point type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格波段。</para>
        ///   <para>它们可以是整数类型或浮点类型。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_multiband_raster">
        /// <para>Output multiband raster</para>
        /// <para><xdoc>
        ///   <para>The output multiband raster dataset.</para>
        ///   <para>If all of the input bands are integer type, the output raster bands will be integer. If any of the input bands are floating point, the output will be floating point.</para>
        ///   <para>If the output is an Esri Grid raster, the name must have less than 10 characters.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出多波段栅格数据集。</para>
        ///   <para>如果所有输入波段均为整数类型，则输出栅格波段将为整数。如果任何输入频段为浮点，则输出将为浮点。</para>
        ///   <para>如果输出为 Esri Grid 栅格，则名称的字符数必须少于 10 个字符。</para>
        /// </xdoc></para>
        /// </param>
        public PrincipalComponents(List<object> _in_raster_bands, object _out_multiband_raster)
        {
            this._in_raster_bands = _in_raster_bands;
            this._out_multiband_raster = _out_multiband_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Principal Components";

        public override string CallName => "sa.PrincipalComponents";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster_bands, _out_multiband_raster, _number_components, _out_data_file];

        /// <summary>
        /// <para>Input raster bands</para>
        /// <para><xdoc>
        ///   <para>The input raster bands.</para>
        ///   <para>They can be integer or floating point type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格波段。</para>
        ///   <para>它们可以是整数类型或浮点类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster bands")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_raster_bands { get; set; }


        /// <summary>
        /// <para>Output multiband raster</para>
        /// <para><xdoc>
        ///   <para>The output multiband raster dataset.</para>
        ///   <para>If all of the input bands are integer type, the output raster bands will be integer. If any of the input bands are floating point, the output will be floating point.</para>
        ///   <para>If the output is an Esri Grid raster, the name must have less than 10 characters.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出多波段栅格数据集。</para>
        ///   <para>如果所有输入波段均为整数类型，则输出栅格波段将为整数。如果任何输入频段为浮点，则输出将为浮点。</para>
        ///   <para>如果输出为 Esri Grid 栅格，则名称的字符数必须少于 10 个字符。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output multiband raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_multiband_raster { get; set; }


        /// <summary>
        /// <para>Number of Principal components</para>
        /// <para><xdoc>
        ///   <para>Number of principal components.</para>
        ///   <para>The number must be greater than zero and less than or equal to the total number of input raster bands.</para>
        ///   <para>The default is the total number of rasters in the input.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>主成分数。</para>
        ///   <para>该数字必须大于零且小于或等于输入栅格波段的总数。</para>
        ///   <para>默认值为输入中的栅格总数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Principal components")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _number_components { get; set; } = null;


        /// <summary>
        /// <para>Output data file</para>
        /// <para><xdoc>
        ///   <para>Output ASCII data file storing principal component parameters.</para>
        ///   <para>The output data file records the correlation and covariance matrices, the eigenvalues and eigenvectors, the percent variance each eigenvalue captures, and the accumulative variance described by the eigenvalues.</para>
        ///   <para>The extension for the output file can be .txt or .asc.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出存储主成分参数的 ASCII 数据文件。</para>
        ///   <para>输出数据文件记录相关和协方差矩阵、特征值和特征向量、每个特征值捕获的方差百分比以及特征值描述的累积方差。</para>
        ///   <para>输出文件的扩展名可以是 .txt 或 .asc。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output data file")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_data_file { get; set; } = null;


        public PrincipalComponents SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}